home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Clean 1.2.4 / Small Demos / rfib.icl < prev    next >
Encoding:
Text File  |  1995-03-10  |  578 b   |  25 lines  |  [TEXT/3PRM]

  1. module rfib
  2.  
  3. /*
  4. The Nfib function using reals.
  5.  
  6. To obtain maximum performance guards are used instead of
  7. pattern matching.
  8.  
  9. To generate an application for this program the Clean 0.8
  10. application should be set to at least 1.1 Mb. To launch the
  11. generated application another 150K of free memory is needed.
  12.  
  13. On a machine without a math coprocessor the execution of this
  14. program might take a (very) long time. Use a smaller start value.
  15. */
  16.  
  17. import StdReal
  18.  
  19. Nfib::Real -> Real
  20. Nfib n    | n < 2.0    =  1.0
  21.                     =    Nfib (n - 1.0) + Nfib (n - 2.0) + 1.0
  22.                       
  23. Start::Real
  24. Start = Nfib 26.0
  25.